<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="../inc/tools.build.js" type="text/javascript"></script>
<script src="o/jquery-2.1.1.js"></script>
<?php
require_once 'appInc.php';
echo _meta_set_nocache();
?>

<title> txt转JSON歌词</title>
 <style>
@font-face {
				font-family: 'inconsolata';
				src: url('../inc/inconsolata.woff') format('woff');
				font-weight: normal;
				font-style: normal;
			}

body {
	margin:0px;
	overflow :auto;}
* , body ,div ,li,ol,span,a{font-family:'inconsolata','思源黑体 CN Light',Verdana, Geneva, sans-serif ; font-size:16px;}

  a{text-decoration: underline;} /*链接无下划线none,有为underline*/
  a:link {color: #06f;text-decoration: underline;} /*未访问的链接 */
  a:visited {color: #0033cc;text-decoration: underline;} /*已访问的链接*/
  a:hover{color: #ff3399;text-decoration: underline;} /*鼠标在链接上 */
  a:active {color: #cc9900;text-decoration: underline} /*点击激活链接*/
li{ color:#0033cc; list-style-type:decimal-leading-zero; margin-left:0px;}
#left .high{color:#dd00dd; font-size:16px;   }

</style>
</head>

<body>
<?php

 //把自己生成一个html文件
 //generation_selfhtml(date('Y-m-d H'),time());
// $tab= new Cltable();
 //$tab->export($_SERVER);
 if(array_key_exists('dirname',$_REQUEST)){
 $dirname = __replace_backslash($_REQUEST['dirname']);
 }else{
 $dirname =  __replace_backslash(dirname(__FILE__));	 
 }
 $up=__replace_backslash( preg_replace('/[\\\\\/]+[a-zA-Z0-9_\-\.]*[\\\\\/]*$/','/',$dirname) );
 
echo "<li><a href='?dirname=".$up."' target='_blank' style=' text-decoration:none;'><span style='color:#33cc33'>上级：".$up."</span></a></li>";
 
echo "<li><a href='?dirname=".$dirname."' target='_blank' style=' text-decoration:none;'><span style='color:#33cc33'>当前：".$dirname."</span></a></li>"; 
function  __replace_backslash($s){
    return preg_replace(array("/\\\\+/","/\/+/"),array("/","/"),$s);	 
}
 function ListDir ($dirname)   
{   //global $g_arrfiles;
    $Ld = dir($dirname);   
    echo "<ul>";   
    while (false !== ($entry = $Ld->read())) {   
        $checkdir=$dirname."/".$entry;   
        if (is_dir($checkdir)&&!preg_match("[^\.]",$entry)){
		   $dirn = __replace_backslash($checkdir);   
           echo "<li><a href='?dirname=".$dirn."' target='_blank' style=' text-decoration:none;'><span style='color:#33cc33'>".$dirn."</span></a></li>";   
          // ListDir($checkdir);   
        }else{   
		    if(!preg_match("[^\.]",$entry)){
				if( true
				//preg_match  (
   // "/(\.php|\.asp|\.jsp|\.html|\.avs|\.htm|\.cpp|\.h|\.xml|\.c)$/",$entry  )
				 ){
			    $fileurl= _completeFilePath2url($checkdir) ;
                echo "<li><a href='"."./OT_mklrcAC.php?filename=".$checkdir."' target=_blank>".$entry."</a> <a href='".$fileurl."'>OPEN</a></li>";  
				//$g_arrfiles[]=$dirname."\n".$entry;
				}
			}
        }   
    }   
    $Ld->close();   
    echo "</ul>";   
} 

ListDir ($dirname) ;
 
 ?>
</body>
</html>